package com.kongyz;

import com.kongyz.shape.Circle;
import com.kongyz.shape.ShapeFactory;

/**
 * @author kongyz
 * @date 2018/6/30 11:53
 * @Description:
 */
public class Demo {
    private static final String colors[]={
            "红色","橙色","黄色","绿色","青色","蓝色","紫色"
    };
    public static void main(String[] args) {
        for (int i=1;i<=20;i++){
            Circle circle=(Circle) ShapeFactory.getCircle(getRandomColor());
            circle.setX((int) (Math.random()*100));
            circle.setY((int) (Math.random()*100));
            circle.setRadius((int)(Math.random()*100)*i);
            circle.draw();
        }
    }

    private static String getRandomColor(){
        return colors[(int) (Math.random()*colors.length)];
    }
}
